package com.itheima.dao;

import com.itheima.pojo.Tag;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;


/**
 * @Description:
 * @Version: V1.0
 */

@Repository
@org.apache.ibatis.annotations.Mapper
public interface TagMapper extends Mapper<Tag> {

    //查询最大排序字段
    @Select("SELECT MAX(t_tag.sort) FROM t_tag")
    Integer findMaxSort();

    //查询引用量
    @Select("SELECT COUNT(t_blog.tag_uid) FROM t_blog WHERE t_blog.tag_uid =#{uid} GROUP BY t_blog.tag_uid")
    Integer citeNum(@Param("uid") String uid);

}
